{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}/Users/jackcavanagh/Documents/AEA_PnP/03_logs/p_and_p_log.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}19 Feb 2026, 14:22:17
{txt}
{com}. 
. 
. **Data used
. use "$dat/Teacher_Competency.dta" , clear 
{txt}
{com}. 
. 
. **Data Prep
. do "$ssrp/02_analysis/1_ssrp_p_and_p_data_cleaning.do"
{txt}
{com}. 
. count  //this is the full sample, 899 
  {res}899
{txt}
{com}. 
. preserve
{txt}
{com}. keep if el_T_Cmp_subject_teach_Ma==1 
{txt}(594 observations deleted)

{com}. count
  {res}305
{txt}
{com}. keep school_id 
{txt}
{com}. duplicates drop 

{p 0 4}{txt}Duplicates in terms of {txt} all variables{p_end}

(76 observations deleted)

{com}. count 
  {res}229
{txt}
{com}. restore 
{txt}
{com}. 
. 
. ****************CLEAN DATA***************
. ***mastering the student curriculum if he or she marked 80% or more of the spelling and grammar questions correct
. 
. ***Minimum knowledge in language as marking 80% of one part test correctly 
. 
. 
. **This has too many missing values to really be useful 
. gen teacher_effectiveness=.
{txt}(899 missing values generated)

{com}. gen teacher_absent_days = . 
{txt}(899 missing values generated)

{com}. forvalues i=1(1)11 {c -(} 
{txt}  2{com}. replace teacher_effectiveness=bl_HT_e06_effectiveness_`i' if bl_HT_e01_teacher_id_`i'==teacher_id  
{txt}  3{com}. 
. replace teacher_absent_days = bl_HT_e05_absent_days_`i' if bl_HT_e01_teacher_id_`i'==teacher_id
{txt}  4{com}. {c )-} 
{txt}(50 real changes made)
(50 real changes made)
(51 real changes made)
(51 real changes made)
(33 real changes made)
(33 real changes made)
(20 real changes made)
(20 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)

{com}. 
. tab teacher_effectiveness, sum(el_T_Cmp_Eg_pct_scored)

{txt}teacher_eff {c |}  Summary of el_T_Cmp_Eg_pct_scored
 ectiveness {c |}        Mean   Std. Dev.       Freq.
{hline 12}{c +}{hline 36}
          1 {c |}  {res} 54.545454   13.017337          22
  {txt}        2 {c |}  {res} 52.579186   15.386787          51
  {txt}        3 {c |}  {res} 53.760684   16.004602          72
  {txt}        4 {c |}  {res} 43.999999   20.369369           5
{txt}{hline 12}{c +}{hline 36}
      Total {c |}  {res} 53.148718   15.489151         150
{txt}
{com}. tab teacher_effectiveness, sum(el_T_Cmp_Ma_pct_scored)

{txt}teacher_eff {c |}  Summary of el_T_Cmp_Ma_pct_scored
 ectiveness {c |}        Mean   Std. Dev.       Freq.
{hline 12}{c +}{hline 36}
          1 {c |}  {res} 86.024844   12.423137          21
  {txt}        2 {c |}  {res} 79.826087   17.975117          50
  {txt}        3 {c |}  {res} 83.509317   16.261729          70
  {txt}        4 {c |}  {res} 49.275363   28.372134           3
{txt}{hline 12}{c +}{hline 36}
      Total {c |}  {res} 81.884058   17.284561         144
{txt}
{com}. 
. ***Demographics
. gen male =bl_T_c06_gender_female==0 if mi_bl_T_c06_gender_female==0
{txt}(175 missing values generated)

{com}.         
. gen age = bl_T_c07_age  if mi_bl_T_c07_age==0
{txt}(175 missing values generated)

{com}.    
. gen age_sq=age^2
{txt}(175 missing values generated)

{com}.         
. gen educ_voc_lower=bl_T_c09_highest_education<=7  if !mi(bl_T_c09_highest_education) 
{txt}(366 missing values generated)

{com}.         replace educ_voc_lower=1 if mv_T_c05_highest_edu<=7 & educ_voc_lower==. & !mi(mv_T_c05_highest_edu)
{txt}(3 real changes made)

{com}.         replace educ_voc_lower=0 if mv_T_c05_highest_edu>=8 & educ_voc_lower==. & !mi(mv_T_c05_highest_edu)
{txt}(127 real changes made)

{com}.         replace educ_voc_lower=1 if el_T_c07_highest_education<=7 & educ_voc_lower==. & !mi(el_T_c07_highest_education)
{txt}(0 real changes made)

{com}.         replace educ_voc_lower=0 if el_T_c07_highest_education>=8 & educ_voc_lower==. & !mi(el_T_c07_highest_education)
{txt}(61 real changes made)

{com}. 
. gen educ_bach=bl_T_c09_highest_education==8  if !mi(bl_T_c09_highest_education) 
{txt}(366 missing values generated)

{com}.         
.         replace educ_bach=1 if mv_T_c05_highest_edu==8 & educ_bach==. & !mi(mv_T_c05_highest_edu)
{txt}(66 real changes made)

{com}.         replace educ_bach=0 if mv_T_c05_highest_edu>8 & educ_bach==. & !mi(mv_T_c05_highest_edu)
{txt}(61 real changes made)

{com}.         replace educ_bach=0 if mv_T_c05_highest_edu<8 & educ_bach==. & !mi(mv_T_c05_highest_edu)
{txt}(3 real changes made)

{com}.         replace educ_bach=1 if el_T_c07_highest_education==8 & educ_bach==. & !mi(el_T_c07_highest_education)
{txt}(35 real changes made)

{com}.         replace educ_bach=0 if el_T_c07_highest_education>8 & educ_bach==. & !mi(el_T_c07_highest_education)
{txt}(26 real changes made)

{com}.         replace educ_bach=0 if el_T_c07_highest_education<8 & educ_bach==. & !mi(el_T_c07_highest_education)
{txt}(0 real changes made)

{com}. 
. ***Small samples so combining bachelors and vocation 
. gen educ_bach_lower=1 if educ_bach==1 | educ_voc_lower==1
{txt}(549 missing values generated)

{com}. replace educ_bach_lower=0 if educ_bach==0 & educ_voc_lower==0
{txt}(374 real changes made)

{com}.         
. gen educ_masters_higher=bl_T_c09_highest_education>=9 if !mi(bl_T_c09_highest_education) 
{txt}(366 missing values generated)

{com}. 
.         replace educ_masters_higher=1 if mv_T_c05_highest_edu>=9 & educ_masters_higher==. & !mi(mv_T_c05_highest_edu)
{txt}(61 real changes made)

{com}.         replace educ_masters_higher=0 if mv_T_c05_highest_edu<9 & educ_masters_higher==. & !mi(mv_T_c05_highest_edu)
{txt}(69 real changes made)

{com}.         replace educ_masters_higher=1 if el_T_c07_highest_education>=9 & educ_masters_higher==. & !mi(el_T_c07_highest_education)
{txt}(26 real changes made)

{com}.         replace educ_masters_higher=0 if el_T_c07_highest_education<9 & educ_masters_higher==. & !mi(el_T_c07_highest_education)
{txt}(35 real changes made)

{com}. sum educ_*

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
educ_voc_l~r {c |}{res}        724    .0124309    .1108756          0          1
{txt}{space 3}educ_bach {c |}{res}        724    .4709945    .4995031          0          1
{txt}educ_bach_~r {c |}{res}        724    .4834254    .5000707          0          1
{txt}educ_maste~r {c |}{res}        724    .5165746    .5000707          0          1
{txt}
{com}. 
. gen years_experience =  bl_T_c12_experience_years if mi_bl_T_c12_experience_years==0
{txt}(176 missing values generated)

{com}.  
.          
. gen years_experience_sq=years_experience^2
{txt}(176 missing values generated)

{com}.         
. gen years_this_school= bl_T_c13_teaching_years_school
{txt}(366 missing values generated)

{com}.         replace years_this_school = mv_T_c07_teacher_this_school if years_this_school==. & !mi(mv_T_c07_teacher_this_school)
{txt}(130 real changes made)

{com}.         replace years_this_school =el_T_c11_years_teaching_school  if years_this_school==.  & !mi(el_T_c11_years_teaching_school)
{txt}(61 real changes made)

{com}. 
. foreach var of varlist male age age_sq educ_voc_lower educ_bach* educ_masters_higher years_experience years_experience_sq years_this_school {c -(} 
{txt}  2{com}.         gen `var'_imp_flag=( `var' == . )
{txt}  3{com}.         gen `var'_imp=`var'
{txt}  4{com}.         sum `var'_imp
{txt}  5{com}.         replace `var'_imp=r(mean) if `var'_imp_flag==1
{txt}  6{com}. {c )-}
{txt}(175 missing values generated)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}male_imp {c |}{res}        724     .538674    .4988467          0          1
{txt}(175 real changes made)
(175 missing values generated)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 5}age_imp {c |}{res}        724    41.41851    11.24222         23         65
{txt}(175 real changes made)
(175 missing values generated)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 2}age_sq_imp {c |}{res}        724    1841.706    988.9884        529       4225
{txt}(175 real changes made)
(175 missing values generated)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
educ_voc_l~p {c |}{res}        724    .0124309    .1108756          0          1
{txt}(175 real changes made)
(175 missing values generated)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
educ_bach_~p {c |}{res}        724    .4709945    .4995031          0          1
{txt}(175 real changes made)
(175 missing values generated)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
educ_b~r_imp {c |}{res}        724    .4834254    .5000707          0          1
{txt}(175 real changes made)
(175 missing values generated)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
educ_maste~p {c |}{res}        724    .5165746    .5000707          0          1
{txt}(175 real changes made)
(176 missing values generated)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
years_expe~p {c |}{res}        723    15.98064    11.43509          0         46
{txt}(176 real changes made)
(176 missing values generated)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
years_~q_imp {c |}{res}        723    385.9613    461.7224          0       2116
{txt}(176 real changes made)
(175 missing values generated)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
years_this~p {c |}{res}        724    7.574586    8.245957          0         39
{txt}(175 real changes made)

{com}.         
.         
. ***Baseline variables: These have funny sample sizes (looks like they are missing "no") 
. sum bl_T_c30_access_textbook_maths bl_T_c31_access_textbook_english bl_HT_effective_assessed

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
bl_T_c30_a~s {c |}{res}        195    1.364103    .4824162          1          2
{txt}bl_T_c31_a~h {c |}{res}        154    1.506494     .501589          1          2
{txt}bl_HT_effe~d {c |}{res}        515    2.551456    .7239462          1          5
{txt}
{com}. 
. *This variable looks like it's missing "yes": ask  
. sum  bl_T_a15_guest_teacher 

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
bl_T_a15_g~r {c |}{res}        533           2           0          2          2
{txt}
{com}. 
. ***Few work at other schools: not considering
. gen bl_work_other_school=1 if bl_T_c15_work_other_school==1
{txt}(893 missing values generated)

{com}.         replace bl_work_other_school=0 if bl_T_c15_work_other_school==2
{txt}(527 real changes made)

{com}.  
. **BL gender variables: coded so that 1 supports gender equality
. gen bl_T_boys_get_opp=(bl_T_c34_boys_get_opportunities>=4)
{txt}
{com}. replace bl_T_boys_get_opp=. if bl_T_c34_boys_get_opportunities==. 
{txt}(366 real changes made, 366 to missing)

{com}. 
. gen bl_T_husbands_more=(bl_T_c35_husband_more_educated>=4)
{txt}
{com}. replace bl_T_husbands_more=. if bl_T_c35_husband_more_educated==. 
{txt}(366 real changes made, 366 to missing)

{com}. 
. gen bl_T_mothers_better_ed=(bl_T_c36_women_better_educator<=2)
{txt}
{com}. replace bl_T_mothers_better_ed=. if bl_T_c36_women_better_educator==. 
{txt}(366 real changes made, 366 to missing)

{com}. 
. gen bl_T_more_imp_boy_school=(bl_T_c37_important_boy_school>=4)
{txt}
{com}. replace bl_T_more_imp_boy_school=. if bl_T_c37_important_boy_school==. 
{txt}(366 real changes made, 366 to missing)

{com}. 
. gen bl_T_women_marry=(bl_T_c38_women_marry<=2)
{txt}
{com}. replace bl_T_women_marry=. if bl_T_c38_women_marry==. 
{txt}(366 real changes made, 366 to missing)

{com}. 
. local bl_gender_vars bl_T_women_marry bl_T_more_imp_boy_school bl_T_mothers_better_ed bl_T_husbands_more bl_T_boys_get_opp
{txt}
{com}. 
. swindex `bl_gender_vars' , gen(bl_gender_eq_swindex) 
{res}{txt}
{com}.  
. 
.  
. **BL opinions on teacher effort 
. ***little variation: bl_T_c45_create_their_lesson
. sum   bl_T_should_follow_crclm

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
bl_T_shoul~m {c |}{res}        899    .3459399    .4759385          0          1
{txt}
{com}. 
. gen bl_T_tries_hard= (bl_T_c47_tries_hard>=4)
{txt}
{com}. replace bl_T_tries_hard=. if bl_T_c47_tries_hard==. 
{txt}(366 real changes made, 366 to missing)

{com}. 
.  /*Not finished cleaning these bl_T_c48_student_work_hard bl_T_c49_difficult_teaching bl_T_c50_teachers_blamed bl_T_c51_motivated_class bl_T_c52_effective_math_teacher bl_T_c53_strict_teacher bl_T_c54_absent_occasionally bl_T_d01_appreciated bl_T_feel_valued bl_T_d02_headmast_helped bl_T_head_helped bl_T_d03_confident_to_teach bl_T_feel_confident bl_T_d04_my_fault_if_fail bl_T_my_fault bl_T_d05_have_materials bl_T_have_materials bl_T_d06_encourage_development bl_T_someone_encourages bl_T_d07_opinions_seem_count bl_T_opinion_counted  */
.  
. *Time use: few have other jobs 
. gen bl_commuting_min = bl_T_e01_spend_commuting_hours*60 + bl_T_e01_spend_commuting_mins
{txt}(366 missing values generated)

{com}. 
. gen bl_grading_home_min= bl_T_e03_home_grading_hours*60 + bl_T_e03_home_grading_mins
{txt}(366 missing values generated)

{com}. gen bl_grading_school_min= bl_T_e03_school_grading_hours*60 + bl_T_e03_school_grading_mins
{txt}(366 missing values generated)

{com}. gen bl_grading_min_total=bl_grading_home_min+bl_grading_school_min 
{txt}(366 missing values generated)

{com}.  
. gen bl_prep_home_min = bl_T_e02_home_preparation_hours*60 + bl_T_e02_home_preparation_mins
{txt}(366 missing values generated)

{com}. gen bl_prep_school_min = bl_T_e02_preparation_hours*60 + bl_T_e02_school_preparation_mins
{txt}(366 missing values generated)

{com}. gen bl_prep_min_total=bl_prep_home_min+bl_prep_school_min 
{txt}(366 missing values generated)

{com}. 
.  
. gen bl_T_behavior=(bl_T_g01_behavior>=3)
{txt}
{com}. replace bl_T_behavior=. if bl_T_g01_behavior==. 
{txt}(366 real changes made, 366 to missing)

{com}. 
. gen bl_T_select_assessment =(bl_T_g03_evaluation>=3 )
{txt}
{com}. replace bl_T_select_assessment=. if bl_T_g03_evaluation==. 
{txt}(366 real changes made, 366 to missing)

{com}. 
. 
. ***************DEFINE ALL OF THESE LOCALS 
. local demo_vars  years_this_school years_experience educ_masters_higher educ_bach_lower age male 
{txt}
{com}. 
. **BL knowledge of student variable (and opinions)
. local bl_t_student_ability bl_T_c39_pass_percent_class9 bl_T_c40_simple_sentence bl_T_c41_substraction bl_T_c42_pass_percent_10board bl_T_c43_pass_percent_12board bl_T_c44_percent_complet_degree
{txt}
{com}. 
. local bl_t_opinion_vars bl_T_should_follow_crclm bl_T_tries_hard
{txt}
{com}. 
. local bl_time_use_vars bl_commuting_min bl_grading_home_min bl_grading_school_min bl_grading_min_total bl_prep_home_min bl_prep_school_min bl_prep_min_total
{txt}
{com}. 
. 
. *Autonomy 
. local bl_autonomy_vars bl_T_activity_selection bl_T_behavior bl_T_modify_timetable bl_T_select_assessment bl_T_fee_pressure bl_T_autonomy_swindex
{txt}
{com}. 
. *****local of baseline non-demographic variables 
. local bl_nondemo_vars   bl_T_c45_create_their_lesson bl_T_c46_follow_govt_circular   bl_T_c48_student_work_hard bl_T_c49_difficult_teaching bl_T_c50_teachers_blamed bl_T_c51_motivated_class bl_T_c52_effective_math_teacher bl_T_c53_strict_teacher bl_T_c54_absent_occasionally bl_T_d01_appreciated bl_T_feel_valued bl_T_d02_headmast_helped bl_T_head_helped bl_T_d03_confident_to_teach bl_T_feel_confident bl_T_d04_my_fault_if_fail bl_T_my_fault bl_T_d05_have_materials bl_T_have_materials bl_T_d06_encourage_development bl_T_someone_encourages bl_T_d07_opinions_seem_count bl_T_opinion_counted 
{txt}
{com}. 
. local bl_nondemo_vars2  bl_gender_eq_swindex `bl_t_student_ability' `bl_t_opinion_vars' `bl_time_use_vars'  `bl_autonomy_vars'
{txt}
{com}. 
. ***Local of student variables
. local bl_student_test_vars bl_Eg_irt_wgt_std  bl_Ma_irt_wgt_std  bl_Od_irt_wgt_std  
{txt}
{com}. local el_student_test_vars el_Eg_irt_wgt_std  el_Ma_irt_wgt_std  el_Od_irt_wgt_std el_Sc_irt_wgt_std
{txt}
{com}. 
. 
. 
. 
. 
. ***Monitoring Visits
. gen num_classes=mv_T_d05_avg_classes
{txt}(197 missing values generated)

{com}. 
. gen teach_extra_classes=. 
{txt}(899 missing values generated)

{com}. replace teach_extra_classes=1 if mv_T_d16_extra_classes<=2
{txt}(489 real changes made)

{com}. replace teach_extra_classes=0 if mv_T_d16_extra_classes==4
{txt}(206 real changes made)

{com}. 
. gen know_kids_behind = (mv_T_d20_aware_of_children>=4)
{txt}
{com}. replace know_kids_behind=. if mv_T_d20_aware_of_children==.
{txt}(197 real changes made, 197 to missing)

{com}. 
. gen mv_total_kids= mv_cl_b05_pupil_present_boy + mv_cl_b05_pupil_present_girls
{txt}(705 missing values generated)

{com}. 
. ***Imputing zero for some questions; should check this 
. foreach var of varlist mv_cl_ask_question_student mv_cl_c08_ask_question_class mv_cl_c09_ask_indvidual_student mv_cl_c10_neutral_way mv_cl_c11_supportive_way mv_cl_answer_supportive mv_cl_c12_disrespectful mv_cl_student_express_idea{c -(} 
{txt}  2{com}. replace `var'=0 if mv_cl_c08_ask_question_class==. & mv_cl_b10_teacher_absent==1
{txt}  3{com}. replace `var'=0 if mv_cl_c08_ask_question_class==. & mv_cl_b10_teacher_absent==1
{txt}  4{com}. {c )-}
{txt}(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)

{com}. 
. ****************Label Variables***************
. ***Demographics
. label var educ_voc_lower "Education: Vocation or Lower"
{txt}
{com}. label var educ_bach "Education: Bachelors"
{txt}
{com}. label var educ_masters_higher "Education: Masters or Higher"
{txt}
{com}. label var educ_bach_lower "Education: Bachlors or Lower"
{txt}
{com}. label var years_this_school "Years at Current School"
{txt}
{com}. label var years_experience "Years Total Experience"
{txt}
{com}. 
. ***Competency 
. ***Minimum knowledge in math is scoring an 80% 
. label var el_T_Cmp_Ma_pct_scored "Percent Scored on Overall Math Test"
{txt}
{com}. label var el_T_Cmp_Ma_primary_pct_scored "Percent Scored on Lower-Primary Math Questions"
{txt}
{com}. label var el_T_Cmp_Ma_primary_knowledge "Minimum Knowledge on Overall Math Test"
{txt}
{com}. label var el_T_Cmp_Ma_prm_kldg_lower "Minimum Knowledge on Lower Primary Math Questions"
{txt}
{com}. label var el_T_Cmp_Ma_only_irt_wgt_std "IRT Math Test, Math teachers only"
{txt}
{com}. label var el_T_Cmp_Ma_irt_wgt_std "IRT Math Test, all teachers"
{txt}
{com}. 
. 
. label var el_T_Cmp_Eg_pct_scored "Percent Scored on Overall English Test"
{txt}
{com}. label var el_T_Cmp_Eg_total_score_part1 "Percent Scored on Part 1 of English Test"
{txt}
{com}. label var el_T_Cmp_Eg_primary_knowledge "Minimum Knowledge on Overall English Test"
{txt}
{com}. label var el_T_Cmp_Eg_only_irt_wgt_std "Std English Test, English teachers only"
{txt}
{com}. label var el_T_Cmp_Eg_irt_wgt_std "Std English Test, all teachers"
{txt}
{com}. 
. ***Student test scores 
. label var bl_Eg_irt_wgt_std "Mean Student English Score (BL)"
{txt}
{com}. label var el_Eg_irt_wgt_std "Mean Student English Score (EL)"
{txt}
{com}. label var bl_Ma_irt_wgt_std "Mean Student Math Score (BL)"
{txt}
{com}. label var el_Ma_irt_wgt_std "Mean Student Math Score (EL)"
{txt}
{com}. label var bl_Od_irt_wgt_std "Mean Student Odia Score (BL)"
{txt}
{com}. label var el_Od_irt_wgt_std "Mean Student Odia Score (EL)"
{txt}
{com}. label var el_Sc_irt_wgt_std "Mean Student Science Score (Sc)"
{txt}
{com}. 
. ***MV Variables
. label var know_kids_behind "T Self-Reports Knows Which Children Behind (MV)"
{txt}
{com}. label var teach_extra_classes "T Teaches Extra Classes (MV)"
{txt}
{com}. label var num_classes "Num Classes Taught (MV)"
{txt}
{com}. *label var mv_T_syllabus_behind "Behind the Syllabus (MV)"
.  
.  
. 
. ***EL Variables 
. label var el_T_Cmp_subject_teach_Ma "Math Teacher"
{txt}
{com}. label var el_T_Cmp_subject_teach_Eg "English Teacher"
{txt}
{com}.  
.  
. 
. 
. ***Create school-level averages:  
. bys school_id: gen obs=_n  //When obs=1, one observation per school 
{txt}
{com}. bys school_id: egen temp_eng= mean(el_T_Cmp_Eg_pct_scored) if el_T_Cmp_subject_teach_Eg==1
{txt}(670 missing values generated)

{com}. bys school_id: egen school_eng_t_pct=max(temp_eng)
{txt}(132 missing values generated)

{com}. drop temp_eng 
{txt}
{com}. 
. label var school_eng_t_pct "English T Competency"
{txt}
{com}. bys school_id: egen temp_math= mean(el_T_Cmp_Ma_pct_scored) if el_T_Cmp_subject_teach_Ma==1
{txt}(594 missing values generated)

{com}. bys school_id: egen school_ma_t_pct=max(temp_math) 
{txt}(86 missing values generated)

{com}. drop temp_math 
{txt}
{com}. label var school_ma_t_pct "Math T Competency"
{txt}
{com}. bys school_id: egen school_male_pct=mean(male)
{txt}(65 missing values generated)

{com}. label var school_male_pct "Percent Teachers Male"
{txt}
{com}. 
. bys school_id: egen school_years_avg=mean(years_experience)
{txt}(65 missing values generated)

{com}. label var school_years_avg "Avg Years Exp of Teachers"
{txt}
{com}. 
. 
.  
. 
{txt}end of do-file

{com}.  
. 
. **Tables
. do "$ssrp/02_analysis/2_ssrp_tables_p_and_p.do"
{txt}
{com}. ***This do file creates the analysis for the SSRP P&P paper 
. 
. ***Run this file from the master do file please!! 
. 
. ****************SUMMARY STATISTICS***************; 
. 
. ***Averages for full sample 
. sum male age  educ_bach_lower years_experience years_this_school 

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}male {c |}{res}        724     .538674    .4988467          0          1
{txt}{space 9}age {c |}{res}        724    41.41851    11.24222         23         65
{txt}educ_bach_~r {c |}{res}        724    .4834254    .5000707          0          1
{txt}years_expe~e {c |}{res}        723    15.98064    11.43509          0         46
{txt}years_this~l {c |}{res}        724    7.574586    8.245957          0         39
{txt}
{com}. ***Summary statistics for paper text 
. count
  {res}899
{txt}
{com}. codebook school_id

{txt}{hline}
{res}school_id{right:ID of the school}
{txt}{hline}

{col 19}type:  numeric ({res}int{txt})

{col 18}range:  [{res}1{txt},{res}348{txt}]{col 55}units:  {res}1
{col 10}{txt}unique values:  {res}300{col 51}{txt}missing .:  {res}0{txt}/{res}899

{txt}{col 19}mean:{res}{col 26} 193.122
{txt}{col 15}std. dev:{res}{col 26}  96.851

{txt}{col 12}percentiles:{col 32}10%{col 42}25%{col 52}50%{col 62}75%{col 72}90%
{res}{col 27}      51{col 37}     117{col 47}     200{col 57}     276{col 67}     323
{txt}
{com}. tab el_T_Cmp_subject_teach_Eg

    {txt}English {c |}
    Teacher {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        604       72.51       72.51
{txt}          1 {c |}{res}        229       27.49      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}        833      100.00
{txt}
{com}. tab el_T_Cmp_subject_teach_Ma

       {txt}Math {c |}
    Teacher {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        528       63.39       63.39
{txt}          1 {c |}{res}        305       36.61      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}        833      100.00
{txt}
{com}. 
. 
. sum el_T_Cmp_Eg_primary_knowledge if el_T_Cmp_subject_teach_Eg==1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
el_T_Cmp_E~e {c |}{res}        229    .0480349    .2143085          0          1
{txt}
{com}. 
. sum el_T_Cmp_Ma_primary_knowledge if el_T_Cmp_subject_teach_Ma==1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
el_T_Cmp_M~e {c |}{res}        305    .8983607      .30267          0          1
{txt}
{com}. 
. 
. ***Table 1  
. **Col 1: just demographics 
. reg el_T_Cmp_Eg_pct_scored  male_imp* age_sq_imp* age_imp*  educ_bach_lower_imp* years_experience_imp* years_experience_sq_imp* standard_utkarsh flexible_utkarsh if el_T_Cmp_subject_teach_Eg==1, robust
{txt}note: age_sq_imp_flag omitted because of collinearity
note: age_imp_flag omitted because of collinearity
note: educ_bach_lower_imp_flag omitted because of collinearity
note: years_experience_sq_imp_flag omitted because of collinearity

Linear regression                               Number of obs     = {res}       229
                                                {txt}{help j_robustsingular:F(9, 218) }        =  {res}        .
                                                {txt}Prob > F          = {res}         .
                                                {txt}R-squared         = {res}    0.0504
                                                {txt}Root MSE          =    {res} 13.825

{txt}{hline 29}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 30}{c |}{col 42}    Robust
{col 1}      el_T_Cmp_Eg_pct_scored{col 30}{c |}      Coef.{col 42}   Std. Err.{col 54}      t{col 62}   P>|t|{col 70}     [95% Con{col 83}f. Interval]
{hline 29}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 15}male_imp_flag {c |}{col 30}{res}{space 2}-12.13537{col 42}{space 2} 7.213067{col 53}{space 1}   -1.68{col 62}{space 3}0.094{col 70}{space 4}-26.35165{col 83}{space 3} 2.080902
{txt}{space 20}male_imp {c |}{col 30}{res}{space 2}-.8826768{col 42}{space 2} 2.568681{col 53}{space 1}   -0.34{col 62}{space 3}0.731{col 70}{space 4}-5.945305{col 83}{space 3} 4.179951
{txt}{space 13}age_sq_imp_flag {c |}{col 30}{res}{space 2}        0{col 42}{txt}  (omitted)
{space 18}age_sq_imp {c |}{col 30}{res}{space 2} .0119962{col 42}{space 2} .0117009{col 53}{space 1}    1.03{col 62}{space 3}0.306{col 70}{space 4}-.0110651{col 83}{space 3} .0350575
{txt}{space 16}age_imp_flag {c |}{col 30}{res}{space 2}        0{col 42}{txt}  (omitted)
{space 21}age_imp {c |}{col 30}{res}{space 2}-1.372121{col 42}{space 2} 1.053189{col 53}{space 1}   -1.30{col 62}{space 3}0.194{col 70}{space 4}-3.447857{col 83}{space 3} .7036142
{txt}{space 4}educ_bach_lower_imp_flag {c |}{col 30}{res}{space 2}        0{col 42}{txt}  (omitted)
{space 9}educ_bach_lower_imp {c |}{col 30}{res}{space 2}-3.278038{col 42}{space 2} 1.966671{col 53}{space 1}   -1.67{col 62}{space 3}0.097{col 70}{space 4}-7.154161{col 83}{space 3} .5980848
{txt}{space 3}years_experience_imp_flag {c |}{col 30}{res}{space 2} 13.78786{col 42}{space 2}  6.51937{col 53}{space 1}    2.11{col 62}{space 3}0.036{col 70}{space 4} .9387957{col 83}{space 3} 26.63692
{txt}{space 8}years_experience_imp {c |}{col 30}{res}{space 2} 1.283309{col 42}{space 2} .5258398{col 53}{space 1}    2.44{col 62}{space 3}0.015{col 70}{space 4}  .246928{col 83}{space 3} 2.319689
{txt}years_experience_sq_imp_flag {c |}{col 30}{res}{space 2}        0{col 42}{txt}  (omitted)
{space 5}years_experience_sq_imp {c |}{col 30}{res}{space 2}-.0233666{col 42}{space 2} .0112903{col 53}{space 1}   -2.07{col 62}{space 3}0.040{col 70}{space 4}-.0456188{col 83}{space 3}-.0011145
{txt}{space 12}standard_utkarsh {c |}{col 30}{res}{space 2}-.0885178{col 42}{space 2} 2.180026{col 53}{space 1}   -0.04{col 62}{space 3}0.968{col 70}{space 4}-4.385144{col 83}{space 3} 4.208108
{txt}{space 12}flexible_utkarsh {c |}{col 30}{res}{space 2}-.5089615{col 42}{space 2} 2.487285{col 53}{space 1}   -0.20{col 62}{space 3}0.838{col 70}{space 4}-5.411166{col 83}{space 3} 4.393243
{txt}{space 23}_cons {c |}{col 30}{res}{space 2}  83.5155{col 42}{space 2} 20.50099{col 53}{space 1}    4.07{col 62}{space 3}0.000{col 70}{space 4} 43.10998{col 83}{space 3}  123.921
{txt}{hline 29}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. sum el_T_Cmp_Eg_pct_scored if e(sample)==1 

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
el_T_Cmp_E.. {c |}{res}        229    57.98455    13.87274   9.230769   87.69231
{txt}
{com}. estadd scalar meaner=r(mean)

{txt}added scalar:
             e(meaner) =  {res}57.984549
{txt}
{com}. eststo A
{txt}
{com}. 
.  
. 
. reg el_T_Cmp_Ma_pct_scored   male_imp* age_sq_imp* age_imp*  educ_bach_lower_imp* years_experience_imp* years_experience_sq_imp* standard_utkarsh flexible_utkarsh if el_T_Cmp_subject_teach_Ma==1, robust
{txt}note: age_sq_imp_flag omitted because of collinearity
note: age_imp_flag omitted because of collinearity
note: educ_bach_lower_imp_flag omitted because of collinearity
note: years_experience_imp_flag omitted because of collinearity
note: years_experience_sq_imp_flag omitted because of collinearity

Linear regression                               Number of obs     = {res}       305
                                                {txt}F(9, 295)         =  {res}     2.38
                                                {txt}Prob > F          = {res}    0.0129
                                                {txt}R-squared         = {res}    0.0786
                                                {txt}Root MSE          =    {res} 10.591

{txt}{hline 29}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 30}{c |}{col 42}    Robust
{col 1}      el_T_Cmp_Ma_pct_scored{col 30}{c |}      Coef.{col 42}   Std. Err.{col 54}      t{col 62}   P>|t|{col 70}     [95% Con{col 83}f. Interval]
{hline 29}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 15}male_imp_flag {c |}{col 30}{res}{space 2} .9359577{col 42}{space 2}  1.57756{col 53}{space 1}    0.59{col 62}{space 3}0.553{col 70}{space 4} -2.16874{col 83}{space 3} 4.040655
{txt}{space 20}male_imp {c |}{col 30}{res}{space 2} 3.547469{col 42}{space 2} 1.687254{col 53}{space 1}    2.10{col 62}{space 3}0.036{col 70}{space 4}  .226889{col 83}{space 3} 6.868049
{txt}{space 13}age_sq_imp_flag {c |}{col 30}{res}{space 2}        0{col 42}{txt}  (omitted)
{space 18}age_sq_imp {c |}{col 30}{res}{space 2} .0123654{col 42}{space 2} .0170399{col 53}{space 1}    0.73{col 62}{space 3}0.469{col 70}{space 4}-.0211697{col 83}{space 3} .0459005
{txt}{space 16}age_imp_flag {c |}{col 30}{res}{space 2}        0{col 42}{txt}  (omitted)
{space 21}age_imp {c |}{col 30}{res}{space 2}-1.741983{col 42}{space 2}  1.45243{col 53}{space 1}   -1.20{col 62}{space 3}0.231{col 70}{space 4}-4.600421{col 83}{space 3} 1.116455
{txt}{space 4}educ_bach_lower_imp_flag {c |}{col 30}{res}{space 2}        0{col 42}{txt}  (omitted)
{space 9}educ_bach_lower_imp {c |}{col 30}{res}{space 2} .6710916{col 42}{space 2} 1.393745{col 53}{space 1}    0.48{col 62}{space 3}0.631{col 70}{space 4}-2.071852{col 83}{space 3} 3.414035
{txt}{space 3}years_experience_imp_flag {c |}{col 30}{res}{space 2}        0{col 42}{txt}  (omitted)
{space 8}years_experience_imp {c |}{col 30}{res}{space 2} 1.231149{col 42}{space 2} .7364066{col 53}{space 1}    1.67{col 62}{space 3}0.096{col 70}{space 4}-.2181274{col 83}{space 3} 2.680425
{txt}years_experience_sq_imp_flag {c |}{col 30}{res}{space 2}        0{col 42}{txt}  (omitted)
{space 5}years_experience_sq_imp {c |}{col 30}{res}{space 2}-.0212339{col 42}{space 2} .0188978{col 53}{space 1}   -1.12{col 62}{space 3}0.262{col 70}{space 4}-.0584255{col 83}{space 3} .0159578
{txt}{space 12}standard_utkarsh {c |}{col 30}{res}{space 2} 1.682569{col 42}{space 2} 1.536378{col 53}{space 1}    1.10{col 62}{space 3}0.274{col 70}{space 4}-1.341081{col 83}{space 3}  4.70622
{txt}{space 12}flexible_utkarsh {c |}{col 30}{res}{space 2} 3.300458{col 42}{space 2} 1.519763{col 53}{space 1}    2.17{col 62}{space 3}0.031{col 70}{space 4} .3095056{col 83}{space 3}  6.29141
{txt}{space 23}_cons {c |}{col 30}{res}{space 2} 124.1855{col 42}{space 2} 24.58155{col 53}{space 1}    5.05{col 62}{space 3}0.000{col 70}{space 4} 75.80804{col 83}{space 3} 172.5629
{txt}{hline 29}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. sum el_T_Cmp_Ma_pct_scored if e(sample)==1 

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
el_T_Cmp_M.. {c |}{res}        305     90.7484     10.8696   26.08696        100
{txt}
{com}. estadd scalar meaner=r(mean)

{txt}added scalar:
             e(meaner) =  {res}90.748397
{txt}
{com}. eststo C
{txt}
{com}. 
. 
. estout A  C    using "$outtab/table1_regs_Eg_Ma.tex", style(tex) replace drop(flexible_utkarsh standard_utkarsh _cons male_imp_flag years_experience_imp_flag ) order(male_imp age_imp age_sq_imp educ_bach_lower_imp years_experience_imp years_experience_sq_imp) ///
>          ///
>         varlabels(male_imp "Male" age_imp "Age" age_sq_imp "Age-Sq" years_experience_imp "Years Experience" years_experience_sq_imp "Years Experience-Sq" educ_bach_lower_imp "Education: Bachelors or Lower") ///
>         nobaselevels noomitted /// //this omits the baselevels of factor variables
>         eqlabels(none) collabels(none) mlabels(none) mgroups(none) label ///
>         cells("b(fmt(3))" "se(fmt(3)par)")  ///
>         stats(N r2 meaner ,  /// 
>         labels(`"Observations"' `" \(R^{c -(}2{c )-}\)"' `"Mean, Dep Var"'  ) fmt(%9.0fc 3 3  )) ///
>         prehead("\begin{c -(}tabular{c )-}{c -(}l*{c -(}@E{c )-}{c -(}c{c )-}{c )-}" ///
>         "\toprule" ///
>         "  &\multicolumn{c -(}1{c )-}{c -(}c{c )-}{c -(}\shortstack{c -(} English Score \\ (PCT) {c )-}{c )-} & \multicolumn{c -(}1{c )-}{c -(}c{c )-}{c -(}\shortstack{c -(}Math Score \\ (PCT){c )-}{c )-}  \\" ///
>         "& \multicolumn{c -(}1{c )-}{c -(}c{c )-}{c -(}(1){c )-}& \multicolumn{c -(}1{c )-}{c -(}c{c )-}{c -(}(2){c )-} \\")  ///
>         posthead("\midrule") ///
>         prefoot("\\" "\midrule" "\multicolumn{c -(}1{c )-}{c -(}c{c )-}{c -(}{c )-}\\")   ///
>         postfoot("\bottomrule" "\end{c -(}tabular{c )-}")
{res}{txt}(output written to {browse  `"/Users/jackcavanagh/Documents/AEA_PnP/04_output/tables/table1_regs_Eg_Ma.tex"'})

{com}.                 
.         cap n estimates clear 
{res}{txt}
{com}.         
. preserve
{txt}
{com}. ***Table 2 
. use "$dat/Teacher_Competency_and_Individual_Student_Score.dta", clear
{txt}
{com}. 
. gen pct_teacher_competency = teacher_competency/100
{txt}
{com}. label var pct_teacher_competency "Content Knowledge"
{txt}
{com}. ***Use a consistent sample 
. 
. reghdfe el_irt_wgt_std_ pct_teacher_competency bl_irt_wgt_std_, cluster(unique_teacher_id) a(student_test_score_subject unique_student_id)
{res}{txt}(dropped 360 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 3 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     9,316
{txt}Absorbing 2 HDFE groups{col 51}F({res}   2{txt},{res}    508{txt}){col 67}= {res}    434.92
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.9336
{txt}{col 51}Adj R-squared{col 67}= {res}    0.8854
{txt}{col 51}Within R-sq.{col 67}= {res}    0.1860
{txt}{col 1}Number of clusters ({res}unique_teacher_id{txt}) {col 30}= {res}       509{txt}{col 51}Root MSE{col 67}= {res}    0.3445

{txt}{ralign 88:(Std. Err. adjusted for {res:509} clusters in unique_teacher_id)}
{hline 23}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 24}{c |}{col 36}    Robust
{col 1}       el_irt_wgt_std_{col 24}{c |}      Coef.{col 36}   Std. Err.{col 48}      t{col 56}   P>|t|{col 64}     [95% Con{col 77}f. Interval]
{hline 23}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
pct_teacher_competency {c |}{col 24}{res}{space 2} .0868861{col 36}{space 2} .0433324{col 47}{space 1}    2.01{col 56}{space 3}0.045{col 64}{space 4} .0017533{col 77}{space 3} .1720188
{txt}{space 7}bl_irt_wgt_std_ {c |}{col 24}{res}{space 2} .4410058{col 36}{space 2} .0150501{col 47}{space 1}   29.30{col 56}{space 3}0.000{col 64}{space 4} .4114378{col 77}{space 3} .4705739
{txt}{space 17}_cons {c |}{col 24}{res}{space 2} .1923565{col 36}{space 2} .0333828{col 47}{space 1}    5.76{col 56}{space 3}0.000{col 64}{space 4} .1267712{col 77}{space 3} .2579418
{txt}{hline 23}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 28}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text}                Absorbed FE{col 29}{c |} Categories{col 42} - Redundant{col 54}  = Num. Coefs{col 69}{c |}
{res}{col 1}{text}{hline 28}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text} student_test_score_subject{col 29}{c |}{space 1}        2{col 42}{space 1}        0{col 54}{result}{space 1}        2{col 68}{text} {col 69}{c |}
{res}{col 1}{text}          unique_student_id{col 29}{c |}{space 1}     3915{col 42}{space 1}        1{col 54}{result}{space 1}     3914{col 68}{text} {col 69}{c |}
{res}{col 1}{text}{hline 28}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
{res}{txt}
{com}. gen insample=e(sample)
{txt}
{com}. 
. reghdfe bl_irt_wgt_std_ pct_teacher_competency treatment  if insample==1, cluster(unique_teacher_id) a(student_test_score_subject)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     9,316
{txt}Absorbing 1 HDFE group{col 51}F({res}   2{txt},{res}    508{txt}){col 67}= {res}      2.27
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.1045
{txt}{col 51}R-squared{col 67}= {res}    0.0013
{txt}{col 51}Adj R-squared{col 67}= {res}    0.0009
{txt}{col 51}Within R-sq.{col 67}= {res}    0.0013
{txt}{col 1}Number of clusters ({res}unique_teacher_id{txt}) {col 30}= {res}       509{txt}{col 51}Root MSE{col 67}= {res}    0.9585

{txt}{ralign 88:(Std. Err. adjusted for {res:509} clusters in unique_teacher_id)}
{hline 23}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 24}{c |}{col 36}    Robust
{col 1}       bl_irt_wgt_std_{col 24}{c |}      Coef.{col 36}   Std. Err.{col 48}      t{col 56}   P>|t|{col 64}     [95% Con{col 77}f. Interval]
{hline 23}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
pct_teacher_competency {c |}{col 24}{res}{space 2} .2587691{col 36}{space 2} .1271866{col 47}{space 1}    2.03{col 56}{space 3}0.042{col 64}{space 4} .0088927{col 77}{space 3} .5086456
{txt}{space 13}treatment {c |}{col 24}{res}{space 2}-.0159505{col 36}{space 2}  .020744{col 47}{space 1}   -0.77{col 56}{space 3}0.442{col 64}{space 4}-.0567051{col 77}{space 3} .0248042
{txt}{space 17}_cons {c |}{col 24}{res}{space 2}-.0945894{col 36}{space 2} .0998173{col 47}{space 1}   -0.95{col 56}{space 3}0.344{col 64}{space 4}-.2906949{col 77}{space 3}  .101516
{txt}{hline 23}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 28}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text}                Absorbed FE{col 29}{c |} Categories{col 42} - Redundant{col 54}  = Num. Coefs{col 69}{c |}
{res}{col 1}{text}{hline 28}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text} student_test_score_subject{col 29}{c |}{space 1}        2{col 42}{space 1}        0{col 54}{result}{space 1}        2{col 68}{text} {col 69}{c |}
{res}{col 1}{text}{hline 28}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
{res}{txt}
{com}. 
. ***Panel A: Combined 
. reghdfe el_irt_wgt_std_ pct_teacher_competency bl_irt_wgt_std_ standard_utkarsh flexible_utkarsh   if insample==1, cluster(unique_teacher_id) a(student_test_score_subject)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     9,316
{txt}Absorbing 1 HDFE group{col 51}F({res}   4{txt},{res}    508{txt}){col 67}= {res}   4994.36
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.7471
{txt}{col 51}Adj R-squared{col 67}= {res}    0.7469
{txt}{col 51}Within R-sq.{col 67}= {res}    0.7457
{txt}{col 1}Number of clusters ({res}unique_teacher_id{txt}) {col 30}= {res}       509{txt}{col 51}Root MSE{col 67}= {res}    0.5118

{txt}{ralign 88:(Std. Err. adjusted for {res:509} clusters in unique_teacher_id)}
{hline 23}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 24}{c |}{col 36}    Robust
{col 1}       el_irt_wgt_std_{col 24}{c |}      Coef.{col 36}   Std. Err.{col 48}      t{col 56}   P>|t|{col 64}     [95% Con{col 77}f. Interval]
{hline 23}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
pct_teacher_competency {c |}{col 24}{res}{space 2} .0077216{col 36}{space 2} .0573082{col 47}{space 1}    0.13{col 56}{space 3}0.893{col 64}{space 4}-.1048686{col 77}{space 3} .1203117
{txt}{space 7}bl_irt_wgt_std_ {c |}{col 24}{res}{space 2} .9100399{col 36}{space 2}  .006471{col 47}{space 1}  140.63{col 56}{space 3}0.000{col 64}{space 4} .8973267{col 77}{space 3} .9227532
{txt}{space 6}standard_utkarsh {c |}{col 24}{res}{space 2} .1289078{col 36}{space 2} .0198597{col 47}{space 1}    6.49{col 56}{space 3}0.000{col 64}{space 4} .0898906{col 77}{space 3}  .167925
{txt}{space 6}flexible_utkarsh {c |}{col 24}{res}{space 2} .1473962{col 36}{space 2}  .019302{col 47}{space 1}    7.64{col 56}{space 3}0.000{col 64}{space 4} .1094746{col 77}{space 3} .1853178
{txt}{space 17}_cons {c |}{col 24}{res}{space 2} .1213499{col 36}{space 2}  .045362{col 47}{space 1}    2.68{col 56}{space 3}0.008{col 64}{space 4} .0322298{col 77}{space 3} .2104701
{txt}{hline 23}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 28}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text}                Absorbed FE{col 29}{c |} Categories{col 42} - Redundant{col 54}  = Num. Coefs{col 69}{c |}
{res}{col 1}{text}{hline 28}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text} student_test_score_subject{col 29}{c |}{space 1}        2{col 42}{space 1}        0{col 54}{result}{space 1}        2{col 68}{text} {col 69}{c |}
{res}{col 1}{text}{hline 28}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
{res}{txt}
{com}. estadd scalar pval = (2 * ttail(e(df_r), abs(_b[pct_teacher_competency] / _se[pct_teacher_competency]) ) )

{txt}added scalar:
               e(pval) =  {res}.89287279
{txt}
{com}. scalar N_clust = e(N_clust)
{txt}
{com}. estadd local school "No" , replace

{txt}added macro:
             e(school) : "{res:No}"

{com}. estadd local student "No" , replace

{txt}added macro:
            e(student) : "{res:No}"

{com}. est store panela_1
{txt}
{com}. 
. 
. reghdfe el_irt_wgt_std_ pct_teacher_competency bl_irt_wgt_std_ if insample==1, cluster(unique_teacher_id) a(student_test_score_subject school_id)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 3 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     9,316
{txt}Absorbing 2 HDFE groups{col 51}F({res}   2{txt},{res}    508{txt}){col 67}= {res}   8995.73
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.7700
{txt}{col 51}Adj R-squared{col 67}= {res}    0.7645
{txt}{col 51}Within R-sq.{col 67}= {res}    0.7324
{txt}{col 1}Number of clusters ({res}unique_teacher_id{txt}) {col 30}= {res}       509{txt}{col 51}Root MSE{col 67}= {res}    0.4937

{txt}{ralign 88:(Std. Err. adjusted for {res:509} clusters in unique_teacher_id)}
{hline 23}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 24}{c |}{col 36}    Robust
{col 1}       el_irt_wgt_std_{col 24}{c |}      Coef.{col 36}   Std. Err.{col 48}      t{col 56}   P>|t|{col 64}     [95% Con{col 77}f. Interval]
{hline 23}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
pct_teacher_competency {c |}{col 24}{res}{space 2} .0882307{col 36}{space 2} .0345186{col 47}{space 1}    2.56{col 56}{space 3}0.011{col 64}{space 4}  .020414{col 77}{space 3} .1560474
{txt}{space 7}bl_irt_wgt_std_ {c |}{col 24}{res}{space 2} .9059356{col 36}{space 2} .0068062{col 47}{space 1}  133.11{col 56}{space 3}0.000{col 64}{space 4} .8925639{col 77}{space 3} .9193073
{txt}{space 17}_cons {c |}{col 24}{res}{space 2} .1505077{col 36}{space 2} .0266369{col 47}{space 1}    5.65{col 56}{space 3}0.000{col 64}{space 4} .0981758{col 77}{space 3} .2028397
{txt}{hline 23}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 28}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text}                Absorbed FE{col 29}{c |} Categories{col 42} - Redundant{col 54}  = Num. Coefs{col 69}{c |}
{res}{col 1}{text}{hline 28}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text} student_test_score_subject{col 29}{c |}{space 1}        2{col 42}{space 1}        0{col 54}{result}{space 1}        2{col 68}{text} {col 69}{c |}
{res}{col 1}{text}                  school_id{col 29}{c |}{space 1}      215{col 42}{space 1}        1{col 54}{result}{space 1}      214{col 68}{text} {col 69}{c |}
{res}{col 1}{text}{hline 28}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
{res}{txt}
{com}. estadd scalar pval = (2 * ttail(e(df_r), abs(_b[pct_teacher_competency] / _se[pct_teacher_competency]) ) )

{txt}added scalar:
               e(pval) =  {res}.0108771
{txt}
{com}. scalar N_clust = e(N_clust)
{txt}
{com}. estadd local school "Yes" , replace

{txt}added macro:
             e(school) : "{res:Yes}"

{com}. estadd local student "No" , replace

{txt}added macro:
            e(student) : "{res:No}"

{com}. est store panela_2
{txt}
{com}. 
. reghdfe el_irt_wgt_std_ pct_teacher_competency bl_irt_wgt_std_ if insample==1, cluster(unique_teacher_id) a(student_test_score_subject unique_student_id)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 3 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     9,316
{txt}Absorbing 2 HDFE groups{col 51}F({res}   2{txt},{res}    508{txt}){col 67}= {res}    434.92
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.9336
{txt}{col 51}Adj R-squared{col 67}= {res}    0.8854
{txt}{col 51}Within R-sq.{col 67}= {res}    0.1860
{txt}{col 1}Number of clusters ({res}unique_teacher_id{txt}) {col 30}= {res}       509{txt}{col 51}Root MSE{col 67}= {res}    0.3445

{txt}{ralign 88:(Std. Err. adjusted for {res:509} clusters in unique_teacher_id)}
{hline 23}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 24}{c |}{col 36}    Robust
{col 1}       el_irt_wgt_std_{col 24}{c |}      Coef.{col 36}   Std. Err.{col 48}      t{col 56}   P>|t|{col 64}     [95% Con{col 77}f. Interval]
{hline 23}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
pct_teacher_competency {c |}{col 24}{res}{space 2} .0868861{col 36}{space 2} .0433324{col 47}{space 1}    2.01{col 56}{space 3}0.045{col 64}{space 4} .0017533{col 77}{space 3} .1720188
{txt}{space 7}bl_irt_wgt_std_ {c |}{col 24}{res}{space 2} .4410058{col 36}{space 2} .0150501{col 47}{space 1}   29.30{col 56}{space 3}0.000{col 64}{space 4} .4114378{col 77}{space 3} .4705739
{txt}{space 17}_cons {c |}{col 24}{res}{space 2} .1923565{col 36}{space 2} .0333828{col 47}{space 1}    5.76{col 56}{space 3}0.000{col 64}{space 4} .1267712{col 77}{space 3} .2579418
{txt}{hline 23}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 28}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text}                Absorbed FE{col 29}{c |} Categories{col 42} - Redundant{col 54}  = Num. Coefs{col 69}{c |}
{res}{col 1}{text}{hline 28}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text} student_test_score_subject{col 29}{c |}{space 1}        2{col 42}{space 1}        0{col 54}{result}{space 1}        2{col 68}{text} {col 69}{c |}
{res}{col 1}{text}          unique_student_id{col 29}{c |}{space 1}     3915{col 42}{space 1}        1{col 54}{result}{space 1}     3914{col 68}{text} {col 69}{c |}
{res}{col 1}{text}{hline 28}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
{res}{txt}
{com}. estadd scalar pval = (2 * ttail(e(df_r), abs(_b[pct_teacher_competency] / _se[pct_teacher_competency]) ) )

{txt}added scalar:
               e(pval) =  {res}.04548167
{txt}
{com}. scalar N_clust = e(N_clust)
{txt}
{com}. estadd local school "No" , replace

{txt}added macro:
             e(school) : "{res:No}"

{com}. estadd local student "Yes" , replace

{txt}added macro:
            e(student) : "{res:Yes}"

{com}. est store panela_3
{txt}
{com}. 
. 
. ***Panel B: Control Schools Only 
. reghdfe el_irt_wgt_std_ pct_teacher_competency bl_irt_wgt_std_ if treatment==0 & insample==1, cluster(unique_teacher_id) a(student_test_score_subject)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     3,232
{txt}Absorbing 1 HDFE group{col 51}F({res}   2{txt},{res}    174{txt}){col 67}= {res}   3236.90
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.7398
{txt}{col 51}Adj R-squared{col 67}= {res}    0.7395
{txt}{col 51}Within R-sq.{col 67}= {res}    0.7386
{txt}{col 1}Number of clusters ({res}unique_teacher_id{txt}) {col 30}= {res}       175{txt}{col 51}Root MSE{col 67}= {res}    0.5310

{txt}{ralign 88:(Std. Err. adjusted for {res:175} clusters in unique_teacher_id)}
{hline 23}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 24}{c |}{col 36}    Robust
{col 1}       el_irt_wgt_std_{col 24}{c |}      Coef.{col 36}   Std. Err.{col 48}      t{col 56}   P>|t|{col 64}     [95% Con{col 77}f. Interval]
{hline 23}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
pct_teacher_competency {c |}{col 24}{res}{space 2}-.0566836{col 36}{space 2} .0989702{col 47}{space 1}   -0.57{col 56}{space 3}0.568{col 64}{space 4}-.2520202{col 77}{space 3}  .138653
{txt}{space 7}bl_irt_wgt_std_ {c |}{col 24}{res}{space 2} .9249666{col 36}{space 2} .0114964{col 47}{space 1}   80.46{col 56}{space 3}0.000{col 64}{space 4} .9022763{col 77}{space 3}  .947657
{txt}{space 17}_cons {c |}{col 24}{res}{space 2} .1668969{col 36}{space 2} .0760121{col 47}{space 1}    2.20{col 56}{space 3}0.029{col 64}{space 4} .0168725{col 77}{space 3} .3169212
{txt}{hline 23}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 28}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text}                Absorbed FE{col 29}{c |} Categories{col 42} - Redundant{col 54}  = Num. Coefs{col 69}{c |}
{res}{col 1}{text}{hline 28}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text} student_test_score_subject{col 29}{c |}{space 1}        2{col 42}{space 1}        0{col 54}{result}{space 1}        2{col 68}{text} {col 69}{c |}
{res}{col 1}{text}{hline 28}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
{res}{txt}
{com}. estadd scalar pval = (2 * ttail(e(df_r), abs(_b[pct_teacher_competency] / _se[pct_teacher_competency]) ) )

{txt}added scalar:
               e(pval) =  {res}.56756417
{txt}
{com}. scalar N_clust = e(N_clust)
{txt}
{com}. estadd local school "No" , replace

{txt}added macro:
             e(school) : "{res:No}"

{com}. estadd local student "No" , replace

{txt}added macro:
            e(student) : "{res:No}"

{com}. est store panelb_1
{txt}
{com}. 
. reghdfe el_irt_wgt_std_ pct_teacher_competency bl_irt_wgt_std_ if treatment==0 & insample==1, cluster(unique_teacher_id) a(student_test_score_subject school_id)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 3 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     3,232
{txt}Absorbing 2 HDFE groups{col 51}F({res}   2{txt},{res}    174{txt}){col 67}= {res}   3056.33
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.7735
{txt}{col 51}Adj R-squared{col 67}= {res}    0.7681
{txt}{col 51}Within R-sq.{col 67}= {res}    0.7364
{txt}{col 1}Number of clusters ({res}unique_teacher_id{txt}) {col 30}= {res}       175{txt}{col 51}Root MSE{col 67}= {res}    0.5010

{txt}{ralign 88:(Std. Err. adjusted for {res:175} clusters in unique_teacher_id)}
{hline 23}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 24}{c |}{col 36}    Robust
{col 1}       el_irt_wgt_std_{col 24}{c |}      Coef.{col 36}   Std. Err.{col 48}      t{col 56}   P>|t|{col 64}     [95% Con{col 77}f. Interval]
{hline 23}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
pct_teacher_competency {c |}{col 24}{res}{space 2} .0549157{col 36}{space 2} .0554038{col 47}{space 1}    0.99{col 56}{space 3}0.323{col 64}{space 4}-.0544343{col 77}{space 3} .1642658
{txt}{space 7}bl_irt_wgt_std_ {c |}{col 24}{res}{space 2} .9293516{col 36}{space 2} .0119512{col 47}{space 1}   77.76{col 56}{space 3}0.000{col 64}{space 4} .9057637{col 77}{space 3} .9529395
{txt}{space 17}_cons {c |}{col 24}{res}{space 2}  .081696{col 36}{space 2} .0425771{col 47}{space 1}    1.92{col 56}{space 3}0.057{col 64}{space 4}-.0023382{col 77}{space 3} .1657301
{txt}{hline 23}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 28}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text}                Absorbed FE{col 29}{c |} Categories{col 42} - Redundant{col 54}  = Num. Coefs{col 69}{c |}
{res}{col 1}{text}{hline 28}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text} student_test_score_subject{col 29}{c |}{space 1}        2{col 42}{space 1}        0{col 54}{result}{space 1}        2{col 68}{text} {col 69}{c |}
{res}{col 1}{text}                  school_id{col 29}{c |}{space 1}       73{col 42}{space 1}        1{col 54}{result}{space 1}       72{col 68}{text} {col 69}{c |}
{res}{col 1}{text}{hline 28}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
{res}{txt}
{com}. estadd scalar pval = (2 * ttail(e(df_r), abs(_b[pct_teacher_competency] / _se[pct_teacher_competency]) ) )

{txt}added scalar:
               e(pval) =  {res}.32296917
{txt}
{com}. scalar N_clust = e(N_clust)
{txt}
{com}. estadd local school "Yes" , replace

{txt}added macro:
             e(school) : "{res:Yes}"

{com}. estadd local student "No" , replace

{txt}added macro:
            e(student) : "{res:No}"

{com}. est store panelb_2
{txt}
{com}. 
. 
. reghdfe el_irt_wgt_std_ pct_teacher_competency bl_irt_wgt_std_ if treatment==0 & insample==1, cluster(unique_teacher_id) a(student_test_score_subject unique_student_id)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 3 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     3,232
{txt}Absorbing 2 HDFE groups{col 51}F({res}   2{txt},{res}    174{txt}){col 67}= {res}    154.59
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.9388
{txt}{col 51}Adj R-squared{col 67}= {res}    0.8954
{txt}{col 51}Within R-sq.{col 67}= {res}    0.2004
{txt}{col 1}Number of clusters ({res}unique_teacher_id{txt}) {col 30}= {res}       175{txt}{col 51}Root MSE{col 67}= {res}    0.3364

{txt}{ralign 88:(Std. Err. adjusted for {res:175} clusters in unique_teacher_id)}
{hline 23}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 24}{c |}{col 36}    Robust
{col 1}       el_irt_wgt_std_{col 24}{c |}      Coef.{col 36}   Std. Err.{col 48}      t{col 56}   P>|t|{col 64}     [95% Con{col 77}f. Interval]
{hline 23}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
pct_teacher_competency {c |}{col 24}{res}{space 2}  .023305{col 36}{space 2} .0614534{col 47}{space 1}    0.38{col 56}{space 3}0.705{col 64}{space 4}-.0979851{col 77}{space 3} .1445951
{txt}{space 7}bl_irt_wgt_std_ {c |}{col 24}{res}{space 2} .4620073{col 36}{space 2} .0267638{col 47}{space 1}   17.26{col 56}{space 3}0.000{col 64}{space 4} .4091838{col 77}{space 3} .5148307
{txt}{space 17}_cons {c |}{col 24}{res}{space 2} .1413317{col 36}{space 2} .0470198{col 47}{space 1}    3.01{col 56}{space 3}0.003{col 64}{space 4} .0485292{col 77}{space 3} .2341342
{txt}{hline 23}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 28}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text}                Absorbed FE{col 29}{c |} Categories{col 42} - Redundant{col 54}  = Num. Coefs{col 69}{c |}
{res}{col 1}{text}{hline 28}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text} student_test_score_subject{col 29}{c |}{space 1}        2{col 42}{space 1}        0{col 54}{result}{space 1}        2{col 68}{text} {col 69}{c |}
{res}{col 1}{text}          unique_student_id{col 29}{c |}{space 1}     1339{col 42}{space 1}        1{col 54}{result}{space 1}     1338{col 68}{text} {col 69}{c |}
{res}{col 1}{text}{hline 28}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
{res}{txt}
{com}. estadd scalar pval = (2 * ttail(e(df_r), abs(_b[pct_teacher_competency] / _se[pct_teacher_competency]) ) )

{txt}added scalar:
               e(pval) =  {res}.70497883
{txt}
{com}. scalar N_clust = e(N_clust)
{txt}
{com}. estadd local school "No" , replace

{txt}added macro:
             e(school) : "{res:No}"

{com}. estadd local student "Yes" , replace

{txt}added macro:
            e(student) : "{res:Yes}"

{com}. est store panelb_3
{txt}
{com}. 
. ***Panel C: Treatment Schools Only 
. reghdfe el_irt_wgt_std_ pct_teacher_competency bl_irt_wgt_std_ if treatment!=0 & insample==1, cluster(unique_teacher_id) a(student_test_score_subject)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     6,084
{txt}Absorbing 1 HDFE group{col 51}F({res}   2{txt},{res}    333{txt}){col 67}= {res}   6668.99
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.7493
{txt}{col 51}Adj R-squared{col 67}= {res}    0.7491
{txt}{col 51}Within R-sq.{col 67}= {res}    0.7478
{txt}{col 1}Number of clusters ({res}unique_teacher_id{txt}) {col 30}= {res}       334{txt}{col 51}Root MSE{col 67}= {res}    0.5012

{txt}{ralign 88:(Std. Err. adjusted for {res:334} clusters in unique_teacher_id)}
{hline 23}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 24}{c |}{col 36}    Robust
{col 1}       el_irt_wgt_std_{col 24}{c |}      Coef.{col 36}   Std. Err.{col 48}      t{col 56}   P>|t|{col 64}     [95% Con{col 77}f. Interval]
{hline 23}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
pct_teacher_competency {c |}{col 24}{res}{space 2} .0594857{col 36}{space 2} .0644431{col 47}{space 1}    0.92{col 56}{space 3}0.357{col 64}{space 4}-.0672811{col 77}{space 3} .1862525
{txt}{space 7}bl_irt_wgt_std_ {c |}{col 24}{res}{space 2} .9021522{col 36}{space 2} .0078302{col 47}{space 1}  115.22{col 56}{space 3}0.000{col 64}{space 4} .8867494{col 77}{space 3}  .917555
{txt}{space 17}_cons {c |}{col 24}{res}{space 2} .2219769{col 36}{space 2} .0495022{col 47}{space 1}    4.48{col 56}{space 3}0.000{col 64}{space 4} .1246004{col 77}{space 3} .3193534
{txt}{hline 23}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 28}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text}                Absorbed FE{col 29}{c |} Categories{col 42} - Redundant{col 54}  = Num. Coefs{col 69}{c |}
{res}{col 1}{text}{hline 28}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text} student_test_score_subject{col 29}{c |}{space 1}        2{col 42}{space 1}        0{col 54}{result}{space 1}        2{col 68}{text} {col 69}{c |}
{res}{col 1}{text}{hline 28}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
{res}{txt}
{com}. estadd scalar pval = (2 * ttail(e(df_r), abs(_b[pct_teacher_competency] / _se[pct_teacher_competency]) ) )

{txt}added scalar:
               e(pval) =  {res}.35663714
{txt}
{com}. scalar N_clust = e(N_clust)
{txt}
{com}. estadd local school "No" , replace

{txt}added macro:
             e(school) : "{res:No}"

{com}. estadd local student "No" , replace

{txt}added macro:
            e(student) : "{res:No}"

{com}. est store panelc_1
{txt}
{com}. 
. reghdfe el_irt_wgt_std_ pct_teacher_competency bl_irt_wgt_std_ if treatment!=0 & insample==1, cluster(unique_teacher_id) a(student_test_score_subject school_id)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 3 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     6,084
{txt}Absorbing 2 HDFE groups{col 51}F({res}   2{txt},{res}    333{txt}){col 67}= {res}   6050.35
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.7664
{txt}{col 51}Adj R-squared{col 67}= {res}    0.7607
{txt}{col 51}Within R-sq.{col 67}= {res}    0.7306
{txt}{col 1}Number of clusters ({res}unique_teacher_id{txt}) {col 30}= {res}       334{txt}{col 51}Root MSE{col 67}= {res}    0.4895

{txt}{ralign 88:(Std. Err. adjusted for {res:334} clusters in unique_teacher_id)}
{hline 23}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 24}{c |}{col 36}    Robust
{col 1}       el_irt_wgt_std_{col 24}{c |}      Coef.{col 36}   Std. Err.{col 48}      t{col 56}   P>|t|{col 64}     [95% Con{col 77}f. Interval]
{hline 23}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
pct_teacher_competency {c |}{col 24}{res}{space 2} .1172681{col 36}{space 2} .0429256{col 47}{space 1}    2.73{col 56}{space 3}0.007{col 64}{space 4} .0328286{col 77}{space 3} .2017076
{txt}{space 7}bl_irt_wgt_std_ {c |}{col 24}{res}{space 2} .8935453{col 36}{space 2} .0081814{col 47}{space 1}  109.22{col 56}{space 3}0.000{col 64}{space 4} .8774516{col 77}{space 3}  .909639
{txt}{space 17}_cons {c |}{col 24}{res}{space 2} .1784661{col 36}{space 2} .0332368{col 47}{space 1}    5.37{col 56}{space 3}0.000{col 64}{space 4} .1130855{col 77}{space 3} .2438467
{txt}{hline 23}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 28}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text}                Absorbed FE{col 29}{c |} Categories{col 42} - Redundant{col 54}  = Num. Coefs{col 69}{c |}
{res}{col 1}{text}{hline 28}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text} student_test_score_subject{col 29}{c |}{space 1}        2{col 42}{space 1}        0{col 54}{result}{space 1}        2{col 68}{text} {col 69}{c |}
{res}{col 1}{text}                  school_id{col 29}{c |}{space 1}      142{col 42}{space 1}        1{col 54}{result}{space 1}      141{col 68}{text} {col 69}{c |}
{res}{col 1}{text}{hline 28}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
{res}{txt}
{com}. estadd scalar pval = (2 * ttail(e(df_r), abs(_b[pct_teacher_competency] / _se[pct_teacher_competency]) ) )

{txt}added scalar:
               e(pval) =  {res}.00663293
{txt}
{com}. scalar N_clust = e(N_clust)
{txt}
{com}. estadd local school "Yes" , replace

{txt}added macro:
             e(school) : "{res:Yes}"

{com}. estadd local student "No" , replace

{txt}added macro:
            e(student) : "{res:No}"

{com}. est store panelc_2
{txt}
{com}. 
. reghdfe el_irt_wgt_std_ pct_teacher_competency bl_irt_wgt_std_ if treatment!=0 & insample==1, cluster(unique_teacher_id) a(student_test_score_subject unique_student_id)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 3 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     6,084
{txt}Absorbing 2 HDFE groups{col 51}F({res}   2{txt},{res}    333{txt}){col 67}= {res}    287.17
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.9300
{txt}{col 51}Adj R-squared{col 67}= {res}    0.8786
{txt}{col 51}Within R-sq.{col 67}= {res}    0.1791
{txt}{col 1}Number of clusters ({res}unique_teacher_id{txt}) {col 30}= {res}       334{txt}{col 51}Root MSE{col 67}= {res}    0.3487

{txt}{ralign 88:(Std. Err. adjusted for {res:334} clusters in unique_teacher_id)}
{hline 23}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 24}{c |}{col 36}    Robust
{col 1}       el_irt_wgt_std_{col 24}{c |}      Coef.{col 36}   Std. Err.{col 48}      t{col 56}   P>|t|{col 64}     [95% Con{col 77}f. Interval]
{hline 23}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
pct_teacher_competency {c |}{col 24}{res}{space 2} .1365307{col 36}{space 2} .0578626{col 47}{space 1}    2.36{col 56}{space 3}0.019{col 64}{space 4} .0227084{col 77}{space 3}  .250353
{txt}{space 7}bl_irt_wgt_std_ {c |}{col 24}{res}{space 2} .4298586{col 36}{space 2} .0180183{col 47}{space 1}   23.86{col 56}{space 3}0.000{col 64}{space 4} .3944146{col 77}{space 3} .4653026
{txt}{space 17}_cons {c |}{col 24}{res}{space 2} .2072676{col 36}{space 2}   .04474{col 47}{space 1}    4.63{col 56}{space 3}0.000{col 64}{space 4} .1192591{col 77}{space 3} .2952762
{txt}{hline 23}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 28}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text}                Absorbed FE{col 29}{c |} Categories{col 42} - Redundant{col 54}  = Num. Coefs{col 69}{c |}
{res}{col 1}{text}{hline 28}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text} student_test_score_subject{col 29}{c |}{space 1}        2{col 42}{space 1}        0{col 54}{result}{space 1}        2{col 68}{text} {col 69}{c |}
{res}{col 1}{text}          unique_student_id{col 29}{c |}{space 1}     2576{col 42}{space 1}        1{col 54}{result}{space 1}     2575{col 68}{text} {col 69}{c |}
{res}{col 1}{text}{hline 28}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
{res}{txt}
{com}. estadd scalar pval = (2 * ttail(e(df_r), abs(_b[pct_teacher_competency] / _se[pct_teacher_competency]) ) )

{txt}added scalar:
               e(pval) =  {res}.01887289
{txt}
{com}. scalar N_clust = e(N_clust)
{txt}
{com}. estadd local school "No" , replace

{txt}added macro:
             e(school) : "{res:No}"

{com}. estadd local student "Yes" , replace

{txt}added macro:
            e(student) : "{res:Yes}"

{com}. est store panelc_3
{txt}
{com}. 
. 
. local titlesc "& \multicolumn{c -(}3{c )-}{c -(}c{c )-}{c -(}Student Test Scores (SD){c )-}  \\ \textbf{c -(}Panel A: All Schools{c )-} & (1) & (2)& (3) \\ \hline"
{txt}
{com}. 
. esttab panela_1 panela_2 panela_3 ///
> using "$outtab/table2_a.tex", replace ///
> cells("b(fmt(3))" "se(fmt(3)par)" "p(par([ ]) fmt(3))") label nonumber booktabs ///
> keep(pct_teacher_competency) nostar alignment(c) ///
> mlabels(none) collabels(none) posthead("`titlesc'" ) nonotes  frag noobs  stats( N  r2 , labels( `"\# Students"'  `" \(R^{c -(}2{c )-}\)"'  ) fmt( %9.0fc 3))
{res}{txt}(output written to {browse  `"/Users/jackcavanagh/Documents/AEA_PnP/04_output/tables/table2_a.tex"'})

{com}. 
. 
. local titlesc "\textbf{c -(}Panel B: Control Schools {c )-}  \\ \hline"
{txt}
{com}. esttab panelb_1 panelb_2 panelb_3 ///
> using "$outtab/table2_b.tex", replace ///
>  cells("b(fmt(3))" "se(fmt(3)par)" "p(par([ ]) fmt(3))") label nonumber booktabs ///
> keep(pct_teacher_competency) nostar alignment(c) ///
> mlabels(none) collabels(none) posthead("`titlesc'" ) nonotes  frag noobs stats( N r2, labels( `"\# Students"'  `" \(R^{c -(}2{c )-}\)"') fmt( %9.0fc  3))
{res}{txt}(output written to {browse  `"/Users/jackcavanagh/Documents/AEA_PnP/04_output/tables/table2_b.tex"'})

{com}. 
. 
. local titlesc "\textbf{c -(}Panel C: Treatment Schools {c )-} \\ \hline"
{txt}
{com}. esttab panelc_1 panelc_2 panelc_3 ///
> using "$outtab/table2_c.tex", replace ///
>  cells("b(fmt(3))" "se(fmt(3)par)" "p(par([ ]) fmt(3))") nostar label nonumber booktabs ///
> keep(pct_teacher_competency)  alignment(c) ///
> mlabels(none) collabels(none) posthead("`titlesc'" ) nonotes  frag noobs stats( N  r2  school student, labels( `"\# Students"'  `" \(R^{c -(}2{c )-}\)"'  `"School FE"' `"Student FE"'  ) fmt( %9.0fc  3))
{res}{txt}(output written to {browse  `"/Users/jackcavanagh/Documents/AEA_PnP/04_output/tables/table2_c.tex"'})

{com}. 
. restore
{txt}
{com}. 
. 
{txt}end of do-file

{com}. 
. 
. **Figures
. do "$ssrp/02_analysis/3_ssrp_figures_p_and_p.do"
{txt}
{com}. ****SSRP figures ***This do file creates the figures for the SSRP P&P paper 
. 
. ***RUN THIS CODE 
. set graphics on 
{txt}
{com}. 
. ****************GLOBALS***************
.  
. 
. * Make globals for colors, from: https://blog.datawrapper.de/gendercolor/
. global my_treatment_color "133 2 249" //purple for women
{txt}
{com}. global my_control_color "0 196 170" //green for men
{txt}
{com}. 
. 
. ***Summarize the sample for the figure notes
. bys el_T_Cmp_subject_teach_Eg: sum el_T_Cmp_Eg_pct_scored 

{txt}{hline}
-> el_T_Cmp_subject_teach_Eg = 0

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
el_T_Cmp_E.. {c |}{res}        571    50.84467    14.76043   3.076923   86.15385

{txt}{hline}
-> el_T_Cmp_subject_teach_Eg = 1

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
el_T_Cmp_E.. {c |}{res}        229    57.98455    13.87274   9.230769   87.69231

{txt}{hline}
-> el_T_Cmp_subject_teach_Eg = .

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
el_T_Cmp_E.. {c |}{res}          0

{txt}
{com}. bys el_T_Cmp_subject_teach_Ma: sum el_T_Cmp_Ma_pct_scored 

{txt}{hline}
-> el_T_Cmp_subject_teach_Ma = 0

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
el_T_Cmp_M.. {c |}{res}        484    75.46712    21.22229          0        100

{txt}{hline}
-> el_T_Cmp_subject_teach_Ma = 1

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
el_T_Cmp_M.. {c |}{res}        305     90.7484     10.8696   26.08696        100

{txt}{hline}
-> el_T_Cmp_subject_teach_Ma = .

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
el_T_Cmp_M.. {c |}{res}          0

{txt}
{com}. 
. 
. ****************FIGURES***************
. twoway kdensity el_T_Cmp_Eg_pct_scored if el_T_Cmp_subject_teach_Eg==1, lcolor("$my_treatment_color") fcolor("$my_treatment_color %50") recast(area) || ///
> kdensity el_T_Cmp_Eg_pct_scored if el_T_Cmp_subject_teach_Eg==0 , lcolor("$my_control_color") fcolor("$my_control_color %50") recast(area) ///
>         title("English Content Knowledge") legend(ring(0) pos(10) order(1 2) region(lwidth(none)) label(1 "English Teachers") label(2 "Non-English Teachers")) ///
>         xlabel(0(20)100) xtitle("English Content Knowledge (Percent)") ytitle("Density") ///
>         name(english_pct, replace) xline(80)
{res}{txt}
{com}. 
. twoway kdensity el_T_Cmp_Ma_pct_scored if el_T_Cmp_subject_teach_Ma==1, lcolor("$my_treatment_color") fcolor("$my_treatment_color %50") recast(area) || ///
> kdensity el_T_Cmp_Ma_pct_scored if el_T_Cmp_subject_teach_Ma==0 , lcolor("$my_control_color") fcolor("$my_control_color %50") recast(area) ///
>         title("Math Content Knowledge") legend(ring(0) pos(10) order(1 2) region(lwidth(none)) label(1 "Math Teachers") label(2 "Non-Math Teachers")) ///
>         xlabel(0(20)100) xtitle("Math Content Knowledge (Percent)") ytitle("Density") ///
>         name(math_pct, replace) xline(80) 
{res}{txt}
{com}. 
. 
. 
. 
. graph combine math_pct english_pct,  rows(2)
{txt}(note: scheme modern not found, using s2color)
(note: scheme modern not found, using s2color)
(note: scheme modern not found, using s2color)
(note: scheme modern not found, using s2color)
{res}{txt}
{com}. graph export "$outfig/figure1_kdensity_math_eng_uncondit.png",replace 
{txt}(file /Users/jackcavanagh/Documents/AEA_PnP/04_output/figures/figure1_kdensity_math_eng_uncondit.png written in PNG format)

{com}. graph export "$outfig/figure1_kdensity_math_eng_uncondit.pdf",replace 
{txt}(file /Users/jackcavanagh/Documents/AEA_PnP/04_output/figures/figure1_kdensity_math_eng_uncondit.pdf written in PDF format)

{com}. 
. 
. 
. 
{txt}end of do-file

{com}. 
. log close 
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}/Users/jackcavanagh/Documents/AEA_PnP/03_logs/p_and_p_log.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}19 Feb 2026, 14:22:22
{txt}{.-}
{smcl}
{txt}{sf}{ul off}